CREATE TABLE [dbo].[GIA_TOUR_CO_BAN]
(
[MA_TOUR] [char] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[LOAI_KHACH] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[DO_TUOI] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[GIA] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[GIA_TOUR_CO_BAN] ADD CONSTRAINT [CK__GIA_TOUR___DO_TU__1A14E395] CHECK (([DO_TUOI]='TRE NHO' OR [DO_TUOI]='NGUOI LON' OR [DO_TUOI]='TRE EM' OR [DO_TUOI]='EM BE'))
GO
ALTER TABLE [dbo].[GIA_TOUR_CO_BAN] ADD CONSTRAINT [CK__GIA_TOUR___LOAI___1920BF5C] CHECK (([LOAI_KHACH]='VIET NAM' OR [LOAI_KHACH]='NUOC NGOAI' OR [LOAI_KHACH]='VIET KIEU'))
GO
ALTER TABLE [dbo].[GIA_TOUR_CO_BAN] ADD CONSTRAINT [CK__GIA_TOUR_CO__GIA__1B0907CE] CHECK (([GIA]>=(0)))
GO
ALTER TABLE [dbo].[GIA_TOUR_CO_BAN] ADD CONSTRAINT [PK_GTCB] PRIMARY KEY CLUSTERED  ([MA_TOUR], [LOAI_KHACH], [DO_TUOI]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[GIA_TOUR_CO_BAN] ADD CONSTRAINT [FK_GIATOURCB_TOUR] FOREIGN KEY ([MA_TOUR]) REFERENCES [dbo].[TOUR] ([MA_TOUR])
GO
